<?php

include_once '../../library/config.php';
include_once '../../model/userlist.php';
include_once '../../library/smshelper.php';

$list = new MySqlHelper();
$entity = new UserList();
$req = new InoLinkCom();
$req->request();

try {
    if ($entity->select("myid")->where("account=" . $req['telphone'])->get_first_rows()) {
        throw new Exception("103");
    }
    $req->mobilephone = $req['telphone'];
    $req->sign='麓遥';
    $code = $req->validate();
    echo '{"smstoken":"' . md5($code . $req['telphone'] . rss_prikey) . '"}';
} catch (Exception $ex) {
    $list->rsscode($ex);
    echo $list->toJson();
}


